import { RouteRecordRaw } from "vue-router"

interface IModules {
  default: RouteRecordRaw[]
}
// 获取全部本地路由
const modules = import.meta.glob('./*/*.ts')
export const appRoutes = async (): Promise<RouteRecordRaw[]> => {
  const appRoutes:RouteRecordRaw[] = []
  for(const item in modules) {
    const route: IModules = await modules[item]() as IModules
    appRoutes.push(route.default[0])
  }
  return appRoutes
}
